/**
 * Created by myd on 15/10/21.
 */

Ext.define('MyApp.model.CarModel', {
    extend: 'Ext.data.Model',
    requires: [
        'Ext.data.reader.Json'
    ],

    fields: [
        {name: 'car_pk', type: 'string'},
        {name: 'car_name', type: 'string'},
        {name: 'car_about', type: 'string'},
        {name: 'car_image', type: 'string'},
        {
            name:'displayStatus',
            convert:function(value, record){
                var v = record.data.car_status;
                if(null == v)
                    return '<span class="red">未知</span>';
                else if(1 == v)
                    return '<span class="blue">启用</span>';
                else
                    return '<span class="red">禁用</span>';
            },
            mapping:'displayStatus'
        },'car_status'

    ]


});